package com.bao.test.test05;

/**
 * @author baoye
 * @date 2024-08-08/19:20
 */
public class NumberPrinter extends Thread{
    private Printer p;

    public NumberPrinter(Printer p) {
        this.p = p;
    }

    public NumberPrinter() {
    }

    public NumberPrinter(String name, Printer p) {
        super(name);
        this.p = p;
    }

    public Printer getP() {
        return p;
    }

    public void setP(Printer p) {
        this.p = p;
    }

    @Override
    public void run() {
        for (int i = 1; i <= 52; i++) {
            p.print(i);
        }
    }
}
